<?php use_javascripts_for_form($form) ?>
<?php use_helper('SEstadisticas') ?>
<?php echo_title('Agregar usuario') ?>


<div id="admin_container">
<h1>Agregar usuario</h1>

<?php include_partial('grupo/flashes') ?>

<div id="admin_content">
  <div id="admin_form">
  <form method="post" action="<?php echo url_for('@grupo_addUser?id=' . $form->getObject()->group_id) ?>">
  <?php echo $form->renderHiddenFields(false) ?>

  <?php if ($form->hasGlobalErrors()): ?>
  <?php echo $form->renderGlobalErrors() ?>
  <?php endif; ?>

  <fieldset>
  <?php foreach ($form->getFormFieldSchema() as $field): ?>
    <?php if($field->isHidden()) continue; ?>
    <div class="admin_form_row">
    <?php if($field->hasError()) echo $field->renderError() ?>
    <div>
    <?php echo $field->renderLabel() ?>
    
    <div class="content">
    <?php echo $field->render() ?>
    </div>
    
    </div>
    </div>    
  <?php endforeach; ?>
  </fieldset>

  <ul class="admin_actions">
    <li class="admin_action_list"><?php echo link_to('Usuarios','@grupo_users?id=' . $form->getObject()->group_id) ?></li>
    <li><input type="submit" value="Guardar"></li>
    <li><input name="_save_and_add" type="submit" value="Guardar y crear otro"></li>
  </ul>

  </form>
  </div>
</div>
</div>
